import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist' // Pinia的数据持久化插件
import '@/styles/index.scss'
import svgIcon from '@/icons'
import 'element-plus/dist/index.css'
import '@/router/permission' // 路由守卫
import * as ELIcon from '@element-plus/icons-vue'
import i18n from '@/i18n'
import filters from './utils/filters'

const pinia = createPinia()
pinia.use(piniaPluginPersist)

const app = createApp(App)
for (const iconName in ELIcon) {
  app.component(iconName, ELIcon[iconName])
}

filters(app)
svgIcon(app)
app.use(router)
app.use(pinia)
app.use(i18n)

app.mount('#app')
